﻿using Student;
using System;
using System.Windows.Forms;

namespace Teacher
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void Stu_group_Click(object sender, EventArgs e)
        {
            select_Group stg_frm = new select_Group();
            stg_frm.ShowDialog();
        }

        private void MainForm_Shown(object sender, EventArgs e)
        {
            control_forms();
        }

        private void control_forms()
        {
            this.Visible = false;
            Teacher.登录.导师端登录 frm_login = new Teacher.登录.导师端登录();
            if (frm_login.ShowDialog() == DialogResult.OK)
            {
                this.Visible = true;
                tea_name.Text = Models.LogInfo.teacher.teacher_name;
                tea_uname.Text = Models.LogInfo.teacher.teacher_uname;

            }
            else
                this.Close();
        }
        private void clear_controls()
        {
            tea_name.Text = "";
            phone.Text = "";
            tea_uname.Text = "";

            this.Visible = false;
            
            Models.LogInfo.teacher = null;
        }

        private void Logout_Click(object sender, EventArgs e)
        {
            clear_controls();
            control_forms();
        }

        private void Result_Click(object sender, EventArgs e)
        {
            Result_form result_Form = new Result_form();
            result_Form.ShowDialog();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {

        }
    }
}
